package com.mingqijia.gassafety.webserver.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;


import java.util.Date;
/**
 * <p>
 *
 * @author wanghai
 * @since 2022-02-23
 */

@Data
@ApiModel("客户列表")
public class ConsumerResponse {

    private Integer id;
    private Integer consumerId;
    private String spId;

    private String idStr;

    @ApiModelProperty(value = "模板一/二: 客户类型 默认0:普通客户,1紫荆客户")
    private Integer consumerType;

    @ApiModelProperty(value = "模板一: 户号")
    private String subsCode;
    @ApiModelProperty(value = "模板一: 户号")
    private String subsCodeName;

    @ApiModelProperty("模板二: 用户ID")
    private String memberId;

    @ApiModelProperty("模板二: 用户手机号")
    private String phone;
    @ApiModelProperty("组织编码")
    private String orgCode;
    @ApiModelProperty(value = "模板一: 户名")
    private String custName;

    @ApiModelProperty(value = "模板一: 户址")
    private String custAddress;

    @ApiModelProperty(value = "模板一: 户主手机号")
    private String custPhone;

    @ApiModelProperty(value = "模板一: 户主 用户类型")
    private String custType;

    @ApiModelProperty(value = "模板一: 气户状态")
    private String custStatus;

    @ApiModelProperty(value = "模板一: 客户名字")
    private String name;

    @ApiModelProperty(value = "模板一: 客户企业代码")
    private String companyCode;

    @ApiModelProperty(value = "级别1的联系电话")
    private String levelPhone;

    @ApiModelProperty(value = "模板一: 地址(详细)")
    private String address;

    @ApiModelProperty(value = "模板一: 经度")
    private Double positionLon;

    @ApiModelProperty(value = "模板一: 纬度")
    private Double positionLat;

    @ApiModelProperty(value = "模板一: 所属行业  模板二:所属行业")
    private String industryType;

    @ApiModelProperty(value = "模板一: 所属行业name /模板二 所属行业name")
    private String industryTypeName;

    @ApiModelProperty(value = "模板一: 姓名 /  模板二:联系人姓名")
    private String contactsName;

    @ApiModelProperty(value = "模板一: 电话号 /  模板二:联系人手机号")
    private String contactsTelephone;

    @ApiModelProperty("模板二:客户列表-安装地址")
    private String installationAddress;


    @ApiModelProperty(value = "模板一: 设备总数 / 模板二: 设备总数")
    private Integer equipmentTotal;

    @ApiModelProperty(value = "模板一: 点位总数 / 模板二: 点位总数")
    private Integer pointTotal;

    @ApiModelProperty(value = "模板一: 创建时间 / 模板二: 创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date updatedAt;

    @ApiModelProperty(value = "备注 200字以内")
    private String remark;


    @ApiModelProperty(value = "报警,true存在报警设备, false没有报警设备")
    private Boolean statusAnyalert;

    @ApiModelProperty(value = "故障,true存在故障设备, false没有故障设备")
    private Boolean statusAnybroken;

    @ApiModelProperty(value = "正常 默认false设备正常")
    private Boolean statusAnynormal;

    @ApiModelProperty(value = "true存在离线设备, false没有离线设备")
    private Boolean statusAnyoffline;

    @ApiModelProperty(value = "客户模板 1-报警器后台;  2-销售单")
    private Integer templateType;

    @ApiModelProperty(value = "经纬度")
    private String position;

    @ApiModelProperty(value = "所属组织")
    private String spName;

    @ApiModelProperty(value = "0 正常 1 不可编辑")
    private String status;

    @ApiModelProperty(value = "燃气公司")
    private String companyName;

    @ApiModelProperty(value = "客户地址")
    private String customerAddress;


    @ApiModelProperty(value = "联系人（级别1）姓名")
    private String contactName1;
    @ApiModelProperty(value = "联系人（级别1）联系方式")
    private String contactPhone1;

    @ApiModelProperty(value = "联系人（级别2）姓名")
    private String contactName2;
    @ApiModelProperty(value = "联系人（级别2）联系方式")
    private String contactPhone2;

    @ApiModelProperty(value = "联系人（级别3）姓名")
    private String contactName3;
    @ApiModelProperty(value = "联系人（级别3）联系方式")
    private String contactPhone3;

    @ApiModelProperty(value = "联系人（级别4）姓名")
    private String contactName4;
    @ApiModelProperty(value = "联系人（级别4）联系方式")
    private String contactPhone4;

    @ApiModelProperty(value = "联系人（级别5）姓名")
    private String contactName5;
    @ApiModelProperty(value = "联系人（级别5）联系方式")
    private String contactPhone5;

    @ApiModelProperty(value = "联系人（级别6）姓名")
    private String contactName6;
    @ApiModelProperty(value = "联系人（级别6）联系方式")
    private String contactPhone6;

    @ApiModelProperty(value = "联系人（级别7）姓名")
    private String contactName7;
    @ApiModelProperty(value = "联系人（级别7）联系方式")
    private String contactPhone7;
    @ApiModelProperty(value = "联系人（级别8）姓名")
    private String contactName8;
    @ApiModelProperty(value = "联系人（级别8）联系方式")
    private String contactPhone8;
    @ApiModelProperty(value = "联系人（级别9）姓名")
    private String contactName9;
    @ApiModelProperty(value = "联系人（级别9）联系方式")
    private String contactPhone9;
    @ApiModelProperty(value = "联系人（级别10）姓名")
    private String contactName10;
    @ApiModelProperty(value = "联系人（级别10）联系方式")
    private String contactPhone10;
    @ApiModelProperty(value = "服务状态：正常")
    private Integer normalCount;
    @ApiModelProperty(value = "服务状态：到期<=30天")
    private Integer unexpiredLessThirtyCount;
    @ApiModelProperty(value = "服务状态：到期<=7天")
    private Integer unexpiredLessSevenCount;
    @ApiModelProperty(value = "服务状态：期至")
    private Integer periodCount;
    @ApiModelProperty(value = "服务状态：超期<=7天")
    private Integer expiredLessSevenCount;
    @ApiModelProperty(value = "服务状态：超期>7天")
    private Integer expiredMoreSevenCount;
    @ApiModelProperty(value = "服务信息更新人")
    private String serviceCreator;
    @ApiModelProperty(value = "服务信息更新人名字")
    private String serviceCreatorName;
    @ApiModelProperty(value = "服务信息更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
    private Date serviceUpdateTime;


    public void setContact(Object c) {
        if (StringUtils.isEmpty(c)) return;
        String[] contacts = (String[]) c;
        if (contacts.length <= 0) return;
        this.contactName1 = contacts[0];
        this.contactPhone1 = contacts[1];
        this.contactName2 = contacts[2];
        this.contactPhone2 = contacts[3];
        this.contactName3 = contacts[4];
        this.contactPhone3 = contacts[5];
        this.contactName4 = contacts[6];
        this.contactPhone4 = contacts[7];
        this.contactName5 = contacts[8];
        this.contactPhone5 = contacts[9];
        this.contactName6 = contacts[10];
        this.contactPhone6 = contacts[11];
        this.contactName7 = contacts[12];
        this.contactPhone7 = contacts[13];
        this.contactName8 = contacts[14];
        this.contactPhone8 = contacts[15];
        this.contactName9 = contacts[16];
        this.contactPhone9 = contacts[17];
        this.contactName10 = contacts[18];
        this.contactPhone10 = contacts[19];
    }

    @ApiModelProperty(value = "0-系统录入 1-时刻助手  2-老时刻助手")
    private String source;

    @ApiModelProperty(value = "设备检定时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date verificationTime;

    @ApiModelProperty(value = "功能区域")
    private ConsumerFuncAreaResponse funcArea;

    @ApiModelProperty(value = "设备总数")
    private Integer deviceSum;
    @ApiModelProperty(value = "报警设备")
    private Integer alarmDevice;
    @ApiModelProperty(value = "厂家名称")
    private String manufacturerName;

    @ApiModelProperty("客户类型 1-企业客户 2-个人客户")
    private Integer orderCustType;

    @ApiModelProperty(value = "服务套餐id")
    private Integer pkgId;

    @ApiModelProperty(value = "服务套餐名称")
    private String pkgName;

}
